﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>文件管理器</title>
    <link rel="stylesheet" type="text/css" href="filemgr/res/filemgr.css" />
    <!--vue-->
    <script type="text/javascript" src="res/vue.min.js" charset="utf-8"></script>
    <!--moment-->
    <script type="text/javascript" src="filemgr/res/moment/moment-with-locales.min.js" charset="utf-8"></script>
    <!--jquery-->
    <script type="text/javascript" src="res/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/jquery/jquery-1.9.1.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/jquery/jquery.serializejson.min.js" charset="utf-8"></script>
    <!--bootstrap-->
    <link rel="stylesheet" type="text/css" href="filemgr/res/bootstrap/css/bootstrap.min.css" />
    <script type="text/javascript" src="filemgr/res/bootstrap/js/bootstrap.min.js" charset="utf-8"></script>
    <!--layerui-->
    <link rel="stylesheet" type="text/css" href="filemgr/res/layui/css/layui.css" />
    <script type="text/javascript" src="filemgr/res/layui/layui.js" charset="utf-8"></script>
    <!--up7-->
    <link rel="stylesheet" type="text/css" href="filemgr/res/up7/up7.css" />
    <script type="text/javascript" src="filemgr/res/up7/up7.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/up7/up7.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/up7/up7.file.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/up7/up7.folder.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/up7/up7.js" charset="utf-8"></script>
    <!--down3-->
    <link rel="stylesheet" type="text/css" href="filemgr/res/down3/down.css" />
    <script type="text/javascript" src="filemgr/res/down3/down.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/down3/down.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/down3/down.file.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/down3/down.folder.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/down3/down.js" charset="utf-8"></script>
    <!--filemgr-->
    <script type="text/javascript" src="filemgr/res/down3.vue.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/up7.vue.js" charset="utf-8"></script>
    <script type="text/javascript" src="filemgr/res/filemgr.vue.js" charset="utf-8"></script>
    <!--down3-->
</head>
<body>
    <div class="container">
    	<div class="row">
            <div class="col-md-12">说明：使用了vue,boostrap,layer组件，支持浏览器：ie9+,firefox,chrome<br />
            1.授权码配置：/filemgr/res/filemgr.vue.js
            </div>
        </div>
        <div class="row" id="app">
            <div class="col-md-12">
                <div class="m-t-md row">
                    <div class="col-md-12">
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="btnUp_click">
	                        <img :src="ico.file" />
	                        上传文件</button>
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="btnUpFolder_click">
	                        <img :src="ico.btnUpFd" />
	                        上传目录</button>
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="btnPaste_click">
	                        <img :src="ico.btnPaste" />
	                        粘贴上传</button>
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="btnMkFolder_click">
	                        <img :src="ico.folder1" />
	                        新建文件夹</button>
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="openUp_click">
	                        <img :src="ico.btnPnlUp" />
	                        打开上传面板</button>
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="openDown_click">
	                        <img :src="ico.btnPnlDown" />
	                        打开下载面板</button>
	                    <button class="btn btn-default btn-sm m-r-xs" role="button" @click="btnDowns_click" v-show="idSels.length>0">
	                        <img :src="ico.btnDown" />
	                        批量下载</button>
	                    <button class="btn btn-default btn-sm hide" role="button" @click="">
	                        <img :src="ico.btnDel" />
	                        删除</button>
	                    <div class="form-inline pull-right">
                            <input type="text" class="form-control input-sm" placeholder="请输入关键字" v-model="search.key" @input="searchKey_changed" @keyup.enter="btnSearch_click"/>
                            <button class="btn btn-default btn-sm m-r-xs" role="button" @click="btnSearch_click">
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                                搜索</button>
                        </div>
                    </div>
                </div>
                <!--上传面板-->
                <up7 id="pnl-up" ref="up7" style="display: none;"
                     :config="config.up7"
                     :ico="ico"
                     @load_complete="up7_loadComplete"
                     @item_selected="up7_itemSelected"
                     @file_append="up7_fileAppend"
					 @folder_append="up7_folderAppend"
                     @file_complete="up7_fileComplete"
                     @folder_complete="up7_folderComplete"
                     @unsetup="up7_unsetup"></up7>
                <!--下载面板-->
                <down3 id="pnl-down" ref="down" style="display: none;"
                       :config="config.down3"
                       :ico="ico"
                       @load_complete="down_loadComplete"
                       @same_file_exist="down_sameFileExist"
                       @unsetup="down_unsetup"
                       @folder_sel=down_folderSel></down3>
                <!--路径导航-->
                <ol class="breadcrumb  m-t-xs" style="margin-bottom: -5px;">
                    <li v-for="p in pathNav">
                        <a class="link" @click="nav_click(p)">{{p.nameLoc}}</a>
                    </li>
                </ol>
                <!--文件列表-->
                <table class="table table-hover table-condensed">
                    <thead>
                        <tr>
                            <th style="width:20px"></th>
                            <th style="width:50%;"><input type="checkbox" @change="selAll_click" v-model="idSelAll" />名称</th>
                            <th>编辑</th>
                            <th>大小</th>
                            <th>上传时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-show="folderMker.edit">
                            <td></td>
                            <td>
                                <input class="form-control input-sm" style="width:80%;float:left;" v-model="folderMker.name" ref="tbFdName" @keyup.enter="btnMkFdOk_click" />
                                <a class="btn btn-default btn-sm m-l-xs" @click="btnMkFdOk_click"><img :src="ico.ok" /></a>
                                <a class="btn btn-default btn-sm" @click="btnMkFdCancel_click"><img :src="ico.cancel" /></a>
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr v-for="(f,index) in items" @mouseenter="toolbar_enter($event,index)" @mouseleave="toolbar_leave($event,index)">
                            <td>{{index+1}}</td>
                            <td>
                                <div :name="'v'+index">
                                <input type="checkbox" :value="f.id" v-model="idSels" :name="'ckb'+index"/>
                                <img :src="ico.file" v-show="!f.fdTask" :name="'name'+index"/>
                                <img :src="ico.folder1" v-show="f.fdTask"/>
                                <a @click="open_folder(f)" class="link m-l-xs" :name="'name'+index">{{f.nameLoc}}</a>
                                    </div>
                                <div :name="'edit'+index" style="display:none;">
                                <input class="form-control input-sm" style="width:80%;float:left;" :value="f.nameLoc" :name="'name'+index" @keyup.enter="btnRename_ok(f,index)"/>
                                <a class="btn btn-default btn-sm m-l-xs" @click="btnRename_ok(f,index)"><img :src="ico.ok"/></a>
                                <a class="btn btn-default btn-sm"  @click="btnRename_cancel(f,index)"><img :src="ico.cancel"/></a>
                                    </div>
                            </td>
                            <td>
                            	<div v-show="index==toolbarCur">
	                                <a class="m-r-md link" @click="itemRename_click(f,index)"><img :src="ico.btnEdit"/>重命名</a>
	                                <a class="m-r-md link" @click="itemDown_click(f)"><img :src="ico.btnDown"/>下载</a>
	                                <a class=" link" @click="btnDel_click(f)"><img :src="ico.btnDel"/>删除</a>
                                </div>
                            </td>
                            <td class="col-1">{{f.fdTask?"":f.sizeLoc}}</td>
                            <td class="col-1-5">{{tm_format(f.time)}}</td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="5">
                                <div id="pager"></div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var v_app = null;
        var svrCookie = '';
        //根路径：http://localhost/api/up7/
        var pos = window.location.href.lastIndexOf("/");
        var root = [
            window.location.href.substr(0, pos + 1),
            "api/filemgr/"
        ].join("");
        //http://localhost/filemgr/res/
        var pathRes = [
            window.location.href.substr(0, pos + 1),
            "filemgr/res/"
        ].join("");

        layui.use(['layer'], function () {
            window.layer = layui.layer;
        });

        window.onbeforeunload = function (event) {  }
        window.unload = function (event) { /*pageApp.page_close();*/ };
    </script>
</body>
</html>